<template>
<!-- 顶部 -->
<AppNavbar></AppNavbar>
<!-- 吸顶头部组件 -->
<AppHeaderSticky></AppHeaderSticky>
<!-- 头部组件 -->
<AppHeader></AppHeader>
<!-- 内容容器 -->
<div class="app-body">
  <!-- 二级路由 -->
  <router-view></router-view>
</div>
<!-- 底部组件 -->
<AppFooter></AppFooter>
</template>

<script>
import AppNavbar from '@/components/app-navbar.vue'
import AppHeader from '@/components/app-header.vue'
import AppFooter from '@/components/app-footer.vue'
import AppHeaderSticky from '@/components/app-header-sticky.vue'
import { useStore } from 'vuex'
export default {
  name: 'Layout',
  components: { AppNavbar, AppHeader, AppFooter, AppHeaderSticky },
  setup () {
    // 获取分类数据
    const store = useStore()
    // 使用vuex category模块下的getList方法
    store.dispatch('category/getList')
  }
}
</script>

<style lang="less" scoped>
.app-body {
  min-height: 600px;
}
</style>
